Repository navigation
Count infinite histogram samples once in edge buckets - #5361
sylvesterkaczmarek wants to merge 3 commits into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
|
@yhwen @IsaacYangSLA The histogram regression tests and common-statistics suite pass locally (83 passed, 12 skipped), along with scoped style checks. Could you review this and trigger |
|
IsaacYangSLA
left a comment
There was a problem hiding this comment.
The existing mixed-client histogram finding remains reproducible at this head: #5361 (comment).
With one histogram bin over (-1, 1), clients containing [-inf, 0] and [-inf, 0, inf] aggregate to 2 samples, or 3 with the clients reversed, instead of 5. Endpoint bounds depend on each client's infinity signs, while accumulate_hists matches bins by their exact ranges and retains the first client's ranges. The newly independent positive-endpoint condition makes these one-bin keys differ, so a client's entire contribution disappears. Please keep bin ranges compatible across clients or reconcile their ranges during aggregation, and cover differing infinity patterns in an integration test.
The 24 changed histogram tests pass, but their aggregation case uses the same infinity pattern at both clients and misses this scenario. This review confirms the existing issue without adding a duplicate inline comment.
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
|
@IsaacYangSLA Thanks for reproducing the mixed-client failure. Addressed in |
Fixes #5360.
Description
Remove the extra degenerate infinity bucket from
get_std_histogram_buckets: those samples have already been included in the first or last bucket. Make the positive-infinity check independent of the negative-infinity check so a one-bin histogram can include both endpoints.The result retains the requested number of bins and counts each infinite sample once. Finite input handling, explicit-range behavior and NaN exclusion remain unchanged. Automatic range inference with infinite inputs is not changed.
Validation
Ten new cases cover negative/positive infinities separately and together, one-bin and all-infinite inputs, finite controls, NaNs, out-of-range finite values, empty inputs, read-only strided views and nonmutation. A dataframe-to-global-histogram check verifies two client datasets produce counts
[3, 1, 3], totaling their seven nonmissing samples../runtest.sh -spassed on both changed files: Black, isort and flake8.git diff --checkpassed.Tested on macOS with Python 3.12.11 and NumPy 2.5.3. The full
runtest.shsuite and a deployed federated job were not run. No dependency, workflow or configuration changes.Types of changes